#!/bin/sh
curl http://127.0.0.1:3000/idls/stop_add_data_and_system
echo ""
echo "stop idls by api"

ps -aux | grep java | grep 'axe-idls-24' | grep -v grep | awk '{print $2}' | while read pid
do
    echo "api stop failed, kill idls pid=$pid"
    kill -9 $pid
done

echo "restart will after 3s"
sleep 3s
java -jar -Dfile.encoding=utf-8 target/axe-idls-24.3.7-SNAPSHOT.jar &
